Why Create PDF from HTML?
Both PDF and HTML file format are the hottest format over the internet. PDF is easy to share and HTML is necessary for many websites. So, usually we may have requirements to create PDF from HTML files.
How to Create PDF from HTML?
There are many converters which can convert HTML to PDF, and some with special effect provided such as Spire PDF Converter which supports converts HTML to PDF, Doc to PDF, Excel to PDF, Image to PDF and text to PDF.
On the other hand, programmers can directly use C# to create PDF from HTML.Spire.PDF for .NET, a PDF document creation component that enables your .NET applications to read, write and manipulate PDF documents without using Adobe Acrobat allows users to convert files from HTML to PDF.
Spire.PDF for .NET presents an easy way to create PDF from HTML. Download Spire.PDF for .NET (or Spire.Offce) with .NET framework 2.0 (or above) together and use the C#/VB.NET code below to create PDF from HTML.
C# Create PDF from HTML:
01 using System;
02 using Spire.Pdf;
03
04 namespace FromHTML
05 {
06 class Program
07 {
08 static void Main(string[] args)
09 {
10 //Create a pdf document.
11 PdfDocument doc = new PdfDocument();
12
13 String url = "http://www.e-iceblue.com/";
14 doc.LoadFromHTML(url, false, true, true);
15
16 //Save pdf file.
17 doc.SaveToFile("FromHTML.pdf");
18 doc.Close();
19
20 //Launching the Pdf file.
21 System.Diagnostics.Process.Start("FromHTML.pdf");
22 }
23
24 }
25 }
VB.NET Create PDF from HTML
01 Imports Spire.Pdf
02
03 Namespace FromHTML
04 Friend Class Program
05 Shared Sub Main(ByVal args() As String)
06 'Create a pdf document.
07 Dim doc As New PdfDocument()
08
09 Dim url As String = "http://www.e-iceblue.com/"
10 doc.LoadFromHTML(url, False, True, True)
11
12 'Save pdf file.
13 doc.SaveToFile("FromHTML.pdf")
14 doc.Close()
15
16 'Launching the Pdf file.
17 Process.Start("FromHTML.pdf")
18 End Sub
19
20 End Class
21 End Namespace
More about Spire.PDF
Download Spire.PDF
Purchase Spire.PDF
Both PDF and HTML file format are the hottest format over the internet. PDF is easy to share and HTML is necessary for many websites. So, usually we may have requirements to create PDF from HTML files.
How to Create PDF from HTML?
There are many converters which can convert HTML to PDF, and some with special effect provided such as Spire PDF Converter which supports converts HTML to PDF, Doc to PDF, Excel to PDF, Image to PDF and text to PDF.
On the other hand, programmers can directly use C# to create PDF from HTML.Spire.PDF for .NET, a PDF document creation component that enables your .NET applications to read, write and manipulate PDF documents without using Adobe Acrobat allows users to convert files from HTML to PDF.
Spire.PDF for .NET presents an easy way to create PDF from HTML. Download Spire.PDF for .NET (or Spire.Offce) with .NET framework 2.0 (or above) together and use the C#/VB.NET code below to create PDF from HTML.
C# Create PDF from HTML:
01 using System;
02 using Spire.Pdf;
03
04 namespace FromHTML
05 {
06 class Program
07 {
08 static void Main(string[] args)
09 {
10 //Create a pdf document.
11 PdfDocument doc = new PdfDocument();
12
13 String url = "http://www.e-iceblue.com/";
14 doc.LoadFromHTML(url, false, true, true);
15
16 //Save pdf file.
17 doc.SaveToFile("FromHTML.pdf");
18 doc.Close();
19
20 //Launching the Pdf file.
21 System.Diagnostics.Process.Start("FromHTML.pdf");
22 }
23
24 }
25 }
VB.NET Create PDF from HTML
01 Imports Spire.Pdf
02
03 Namespace FromHTML
04 Friend Class Program
05 Shared Sub Main(ByVal args() As String)
06 'Create a pdf document.
07 Dim doc As New PdfDocument()
08
09 Dim url As String = "http://www.e-iceblue.com/"
10 doc.LoadFromHTML(url, False, True, True)
11
12 'Save pdf file.
13 doc.SaveToFile("FromHTML.pdf")
14 doc.Close()
15
16 'Launching the Pdf file.
17 Process.Start("FromHTML.pdf")
18 End Sub
19
20 End Class
21 End Namespace
More about Spire.PDF
Download Spire.PDF
Purchase Spire.PDF